﻿using System;
using System.Data;
using EAS.Data.Access;
using EAS.Data.ORM;
using System.Runtime.Serialization;

namespace DataStudio
{
    [Serializable, Table("EAS_GROUPS"), Index]
    partial class Group : DataEntity<Group>
    {
        // Methods
        public Group()
        {
        }

        protected Group(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        // Properties
        [Column("ATTRIBUTES", "属性")]
        public int Attributes
        {
            get
            {
                return base.GetValue<int>("ATTRIBUTES");
            }
            set
            {
                base["ATTRIBUTES"] = value;
            }
        }

        [Column("DESCRIPTION", "说明")]
        public string Description
        {
            get
            {
                return base.GetValue<string>("DESCRIPTION");
            }
            set
            {
                base["DESCRIPTION"] = value;
            }
        }

        [Column("ICON", "图标", DbType.Binary)]
        public byte[] Icon
        {
            get
            {
                return base.GetValue<byte[]>("ICON");
            }
            set
            {
                base["ICON"] = value;
            }
        }

        [Column("ID", "分组ID")]
        public int ID
        {
            get
            {
                return base.GetValue<int>("ID");
            }
            set
            {
                base["ID"] = value;
            }
        }

        [PrimaryKey, Column("NAME", "分组名称")]
        public string Name
        {
            get
            {
                return base.GetValue<string>("NAME");
            }
            set
            {
                base["NAME"] = value;
            }
        }

        [Column("OWNER", "所有者"), PrimaryKey]
        public string Owner
        {
            get
            {
                return base.GetValue<string>("OWNER");
            }
            set
            {
                base["OWNER"] = value;
            }
        }

        [PrimaryKey, Column("PARENT", "上级ID")]
        public int Parent
        {
            get
            {
                return base.GetValue<int>("PARENT");
            }
            set
            {
                base["PARENT"] = value;
            }
        }

        [Column("SORTCODE", "排序码")]
        public int Sortcode
        {
            get
            {
                return base.GetValue<int>("SORTCODE");
            }
            set
            {
                base["SORTCODE"] = value;
            }
        }

        [Column("WFModule", "流程图")]
        public string WFModule
        {
            get
            {
                return base.GetValue<string>("WFModule");
            }
            set
            {
                base["WFModule"] = value;
            }
        }
    }
}
